﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using ZFB.Common;

namespace ZFB.IServices
{
    public interface IAdminUserServices
    {
        /// <summary>
        /// 新增用户返回id
        /// </summary>
        /// <param name="name"></param>
        /// <param name="phoneNum"></param>
        /// <param name="password"></param>
        /// <param name="email"></param>
        /// <param name="cityid"></param>
        /// <returns></returns>
        Task<ApiResult> AddNewUserAsync(string name,string phoneNum,string password,string email,long? cityid);
        /// <summary>
        /// 更新用户
        /// </summary>
        /// <param name="id"></param>
        /// <param name="name"></param>
        /// <param name="phoneNum"></param>
        /// <param name="password"></param>
        /// <param name="email"></param>
        /// <param name="cityid"></param>
        /// <returns></returns>
        Task<ApiResult> UpdateUserAsync(long id,string name, string phoneNum,string email, long? cityid);
        /// <summary>
        /// 修改密码
        /// </summary>
        /// <param name="phoneNum"></param>
        /// <param name="password"></param>
        /// <returns></returns>
        Task<ApiResult> UpdatePswAsync(string phoneNum, string password);
        /// <summary>
        /// 获取所有管理员
        /// </summary>
        /// <param name="cityid"></param>
        /// <returns></returns>
        Task<ApiResult> GetAllAsync();
        /// <summary>
        /// 获取城市下的所有管理员
        /// </summary>
        /// <returns></returns>
        Task<ApiResult> GetAllByCityIdAsync(long? cityid);
        /// <summary>
        /// 根据id查询
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<ApiResult> GetByIdAsync(long id);
        /// <summary>
        /// 根据手机号查询
        /// </summary>
        /// <param name="phoneNum"></param>
        /// <returns></returns>
        Task<ApiResult> GetByPhoneAsync(string phoneNum);
        /// <summary>
        /// 检查用户密码
        /// </summary>
        /// <param name="phoneNum"></param>
        /// <param name="password"></param>
        /// <returns></returns>
        Task<ApiResult> CheckLoginAsync(string phoneNum,string password);
        /// <summary>
        /// 软删除
        /// </summary>
        /// <param name="adminUserId"></param>
        /// <returns></returns>
        Task<ApiResult> MarkDeleteAsync(long adminUserId);
        /// <summary>
        /// 检查用户权限
        /// </summary>
        /// <param name="UserId"></param>
        /// <param name="permissionName"></param>
        /// <returns></returns>
        Task<ApiResult> HasPermissionAsync(long UserId,string permissionName);
        /// <summary>
        /// 登录错误次数
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<ApiResult> RecordLoginErrorAsync(long id);
        /// <summary>
        /// 登录错误次数重置
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<ApiResult> ResetLoginErrorAsync(long id);

    }
}
